<%@ CodePage=1252 %>
<%
'Include Common Files @1-FF2B2619
%>
<!-- #INCLUDE VIRTUAL="/fepace/Common.asp"-->
<!-- #INCLUDE VIRTUAL="/fepace/Cache.asp" -->
<!-- #INCLUDE VIRTUAL="/fepace/Template.asp" -->
<!-- #INCLUDE VIRTUAL="/fepace/Sorter.asp" -->
<!-- #INCLUDE VIRTUAL="/fepace/Navigator.asp" -->
<%
'End Include Common Files

'Initialize Page @1-F4AE12E7
' Variables
Dim PathToRoot, ScriptPath, TemplateFilePath
Dim FileName
Dim Redirect
Dim Tpl, HTMLTemplate
Dim TemplateFileName
Dim ComponentName
Dim PathToCurrentPage
Dim Attributes

' Events
Dim CCSEvents
Dim CCSEventResult

' Connections
Dim DBConnection1

' Page controls
Dim Header
Dim EventosSearch
Dim Eventos
Dim Footer
Dim ChildControls

Redirect = ""
TemplateFileName = "Eventos_list.html"
Set CCSEvents = CreateObject("Scripting.Dictionary")
PathToCurrentPage = "./"
FileName = "Eventos_list.asp"
PathToRoot = "./"
ScriptPath = Left(Request.ServerVariables("PATH_TRANSLATED"), Len(Request.ServerVariables("PATH_TRANSLATED")) - Len(FileName))
TemplateFilePath = ScriptPath
'End Initialize Page

'Authenticate User @1-8FF25281
CCSecurityRedirect "1;2", Empty
'End Authenticate User

'Initialize Objects @1-40D33CA5
Set DBConnection1 = New clsDBConnection1
DBConnection1.Open
Set Attributes = New clsAttributes

' Controls
Set Header = New clsHeader
Set Header.Attributes = Attributes
Header.Initialize "Header", ""
Set EventosSearch = new clsRecordEventosSearch
Set Eventos = New clsGridEventos
Set Footer = New clsFooter
Set Footer.Attributes = Attributes
Footer.Initialize "Footer", ""
Eventos.Initialize DBConnection1

CCSEventResult = CCRaiseEvent(CCSEvents, "AfterInitialize", Nothing)
'End Initialize Objects

'Execute Components @1-0DDD8A49
Header.Operations
EventosSearch.Operation
Footer.Operations
'End Execute Components

'Go to destination page @1-6D35F4FD
If NOT ( Redirect = "" ) Then
    UnloadPage
    Response.Redirect Redirect
End If
'End Go to destination page

'Initialize HTML Template @1-2E9DB4BC
CCSEventResult = CCRaiseEvent(CCSEvents, "OnInitializeView", Nothing)
Set HTMLTemplate = new clsTemplate
Set HTMLTemplate.Cache = TemplatesRepository
HTMLTemplate.LoadTemplate TemplateFilePath & TemplateFileName
HTMLTemplate.SetVar "@CCS_PathToRoot", PathToRoot
Set Tpl = HTMLTemplate.Block("main")
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Nothing)
'End Initialize HTML Template

'Show Page @1-A064939C
Attributes.Show HTMLTemplate, "page:"
Set ChildControls = CCCreateCollection(Tpl, Null, ccsParseOverwrite, _
    Array(Header, EventosSearch, Eventos, Footer))
ChildControls.Show
Dim MainHTML
HTMLTemplate.Parse "main", False
MainHTML = HTMLTemplate.GetHTML("main")
'Dim MNNDKN1P8E6J : MNNDKN1P8E6J="<center><font face=""Arial""><small>&#71;e&#110;&#101;&#114;&#97;&#116;&#101;d <!-- CCS -->wi&#116;&#104; <!-- CCS -->Co&#100;eC&#104;&#97;r&#103;&#101; <!-- SCC -->&#83;tud&#105;o.</small></font></center>"
'If InStr(1, MainHTML, "</body", 1) > 0 Then
'    MainHTML = Replace(MainHTML, "</body", MNNDKN1P8E6J & "</body", 1, -1, 1)
'ElseIf InStr(1, MainHTML, "</frameset", 1) = 0 Then
'    MainHTML = Replace(MainHTML, "</html", MNNDKN1P8E6J & "</html", 1, -1, 1)
'End If
CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeOutput", Nothing)
If CCSEventResult Then Response.Write MainHTML
'End Show Page

'Unload Page @1-CB210C62
UnloadPage
Set Tpl = Nothing
Set HTMLTemplate = Nothing
'End Unload Page

'UnloadPage Sub @1-4AA7A64B
Sub UnloadPage()
    CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeUnload", Nothing)
    If DBConnection1.State = adStateOpen Then _
        DBConnection1.Close
    Set DBConnection1 = Nothing
    Set CCSEvents = Nothing
    Set Attributes = Nothing
    Set Header = Nothing
    Set EventosSearch = Nothing
    Set Eventos = Nothing
    Set Footer = Nothing
End Sub
'End UnloadPage Sub

Class clsRecordEventosSearch 'EventosSearch Class @2-2A0282EC

'EventosSearch Variables @2-9B68B1BE

    ' Public variables
    Public ComponentName
    Public HTMLFormAction
    Public PressedButton
    Public Errors
    Public FormSubmitted
    Public EditMode
    Public Visible
    Public Recordset
    Public TemplateBlock
    Public Attributes

    Public CCSEvents
    Private CCSEventResult

    Public InsertAllowed
    Public UpdateAllowed
    Public DeleteAllowed
    Public ReadAllowed
    Public DataSource
    Public Command
    Public ValidatingControls
    Public Controls

    ' Class variables
    Dim s_IdEvento
    Dim s_NomeEvento
    Dim s_Cidade
    Dim s_UF
    Dim s_Pais
    Dim Button_DoSearch
'End EventosSearch Variables

'EventosSearch Class_Initialize Event @2-F71F08E2
    Private Sub Class_Initialize()

        Visible = True
        Set Errors = New clsErrors
        Set CCSEvents = CreateObject("Scripting.Dictionary")
        Set Attributes = New clsAttributes
        InsertAllowed = False
        UpdateAllowed = False
        DeleteAllowed = False
        ReadAllowed = True
        Dim Method
        Dim OperationMode
        OperationMode = Split(CCGetFromGet("ccsForm", Empty), ":")
        If UBound(OperationMode) > -1 Then 
            FormSubmitted = (OperationMode(0) = "EventosSearch")
        End If
        If UBound(OperationMode) > 0 Then 
            EditMode = (OperationMode(1) = "Edit")
        End If
        ComponentName = "EventosSearch"
        Method = IIf(FormSubmitted, ccsPost, ccsGet)
        Set s_IdEvento = CCCreateControl(ccsTextBox, "s_IdEvento", Empty, ccsInteger, Empty, CCGetRequestParam("s_IdEvento", Method))
        Set s_NomeEvento = CCCreateControl(ccsTextBox, "s_NomeEvento", Empty, ccsText, Empty, CCGetRequestParam("s_NomeEvento", Method))
        Set s_Cidade = CCCreateControl(ccsTextBox, "s_Cidade", Empty, ccsText, Empty, CCGetRequestParam("s_Cidade", Method))
        Set s_UF = CCCreateList(ccsListBox, "s_UF", Empty, ccsText, CCGetRequestParam("s_UF", Method), Empty)
        s_UF.BoundColumn = "IdEstado"
        s_UF.TextColumn = "NomeEstado"
        Set s_UF.DataSource = CCCreateDataSource(dsTable,DBConnection1, Array("SELECT *  " & _
"FROM Estados {SQL_Where} {SQL_OrderBy}", "", ""))
        Set s_Pais = CCCreateList(ccsListBox, "s_Pais", Empty, ccsText, CCGetRequestParam("s_Pais", Method), Empty)
        s_Pais.BoundColumn = "IdPais"
        s_Pais.TextColumn = "PaisDescricao"
        Set s_Pais.DataSource = CCCreateDataSource(dsTable,DBConnection1, Array("SELECT *  " & _
"FROM Paises {SQL_Where} {SQL_OrderBy}", "", ""))
        Set Button_DoSearch = CCCreateButton("Button_DoSearch", Method)
        Set ValidatingControls = new clsControls
        ValidatingControls.addControls Array(s_IdEvento, s_NomeEvento, s_Cidade, s_UF, s_Pais)
    End Sub
'End EventosSearch Class_Initialize Event

'EventosSearch Class_Terminate Event @2-0C5D276C
    Private Sub Class_Terminate()
        Set Errors = Nothing
        Set Attributes = Nothing
    End Sub
'End EventosSearch Class_Terminate Event

'EventosSearch Validate Method @2-B9D513CF
    Function Validate()
        Dim Validation
        ValidatingControls.Validate
        CCSEventResult = CCRaiseEvent(CCSEvents, "OnValidate", Me)
        Validate = ValidatingControls.isValid() And (Errors.Count = 0)
    End Function
'End EventosSearch Validate Method

'EventosSearch Operation Method @2-69AC44BC
    Sub Operation()
        If NOT ( Visible AND FormSubmitted ) Then Exit Sub

        If FormSubmitted Then
            PressedButton = "Button_DoSearch"
            If Button_DoSearch.Pressed Then
                PressedButton = "Button_DoSearch"
            End If
        End If
        Redirect = "Eventos_list.asp"
        If Validate() Then
            If PressedButton = "Button_DoSearch" Then
                If NOT Button_DoSearch.OnClick() Then
                    Redirect = ""
                Else
                    Redirect = "Eventos_list.asp?" & CCGetQueryString("Form", Array(PressedButton, "ccsForm", "Button_DoSearch.x", "Button_DoSearch.y", "Button_DoSearch"))
                End If
            End If
        Else
            Redirect = ""
        End If
    End Sub
'End EventosSearch Operation Method

'EventosSearch Show Method @2-A0D4A974
    Sub Show(Tpl)

        If NOT Visible Then Exit Sub

        EditMode = False
        HTMLFormAction = FileName & "?" & CCAddParam(Request.ServerVariables("QUERY_STRING"), "ccsForm", "EventosSearch" & IIf(EditMode, ":Edit", ""))
        Set TemplateBlock = Tpl.Block("Record " & ComponentName)
        If TemplateBlock is Nothing Then Exit Sub
        TemplateBlock.Variable("HTMLFormName") = ComponentName
        TemplateBlock.Variable("HTMLFormEnctype") ="application/x-www-form-urlencoded"
        Set Controls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _
            Array(s_IdEvento, s_NomeEvento, s_Cidade, s_UF, s_Pais, Button_DoSearch))
        If Not FormSubmitted Then
        End If
        If FormSubmitted Then
            Errors.AddErrors s_IdEvento.Errors
            Errors.AddErrors s_NomeEvento.Errors
            Errors.AddErrors s_Cidade.Errors
            Errors.AddErrors s_UF.Errors
            Errors.AddErrors s_Pais.Errors
            With TemplateBlock.Block("Error")
                .Variable("Error") = Errors.ToString()
                .Parse False
            End With
        End If
        TemplateBlock.Variable("Action") = HTMLFormAction

        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me)
        If Visible Then 
            Attributes.Show TemplateBlock, "EventosSearch" & ":"
            Controls.Show
        End If
    End Sub
'End EventosSearch Show Method

End Class 'End EventosSearch Class @2-A61BA892

Class clsGridEventos 'Eventos Class @9-7DD5388E

'Eventos Variables @9-D2F72DBE

    ' Private variables
    Private VarPageSize
    ' Public variables
    Public ComponentName, CCSEvents
    Public Visible, Errors
    Public DataSource
    Public PageNumber
    Public Command
    Public TemplateBlock
    Public IsDSEmpty
    Public ForceIteration
    Public Attributes
    Private ShownRecords
    Public ActiveSorter, SortingDirection
    Public Recordset

    Private CCSEventResult

    ' Grid Controls
    Public StaticControls, RowControls
    Dim Sorter_IdEvento
    Dim Sorter_NomeEvento
    Dim Sorter_Cidade
    Dim Sorter_UF
    Dim Sorter_Pais
    Dim Sorter_DataInicioEvento
    Dim IdEvento
    Dim NomeEvento
    Dim Cidade
    Dim UF
    Dim Pais
    Dim DataInicioEvento
    Dim Eventos_Insert
    Dim Navigator
'End Eventos Variables

'Eventos Class_Initialize Event @9-11F26429
    Private Sub Class_Initialize()
        ComponentName = "Eventos"
        Visible = True
        Set CCSEvents = CreateObject("Scripting.Dictionary")
        Set Attributes = New clsAttributes
        Set Errors = New clsErrors
        Set DataSource = New clsEventosDataSource
        Set Command = New clsCommand
        PageSize = CCGetParam(ComponentName & "PageSize", Empty)
        If IsNumeric(PageSize) And Len(PageSize) > 0 Then
            If PageSize <= 0 Then Errors.AddError(CCSLocales.GetText("CCS_GridPageSizeError", Empty))
            If PageSize > 100 Then PageSize = 100
        End If
        If NOT IsNumeric(PageSize) OR IsEmpty(PageSize) Then _
            PageSize = 20 _
        Else _
            PageSize = CInt(PageSize)
        PageNumber = CCGetParam(ComponentName & "Page", 1)
        If Not IsNumeric(PageNumber) And Len(PageNumber) > 0 Then
            Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty))
            PageNumber = 1
        ElseIf Len(PageNumber) > 0 Then
            If PageNumber > 0 Then
                PageNumber = CInt(PageNumber)
            Else
                Errors.AddError(CCSLocales.GetText("CCS_GridPageNumberError", Empty))
                PageNumber = 1
            End If
        Else
            PageNumber = 1
        End If
        ActiveSorter = CCGetParam("EventosOrder", Empty)
        SortingDirection = CCGetParam("EventosDir", Empty)
        If NOT(SortingDirection = "ASC" OR SortingDirection = "DESC") Then _
            SortingDirection = Empty

        Set Sorter_IdEvento = CCCreateSorter("Sorter_IdEvento", Me, FileName)
        Set Sorter_NomeEvento = CCCreateSorter("Sorter_NomeEvento", Me, FileName)
        Set Sorter_Cidade = CCCreateSorter("Sorter_Cidade", Me, FileName)
        Set Sorter_UF = CCCreateSorter("Sorter_UF", Me, FileName)
        Set Sorter_Pais = CCCreateSorter("Sorter_Pais", Me, FileName)
        Set Sorter_DataInicioEvento = CCCreateSorter("Sorter_DataInicioEvento", Me, FileName)
        Set IdEvento = CCCreateControl(ccsLink, "IdEvento", Empty, ccsInteger, Empty, CCGetRequestParam("IdEvento", ccsGet))
        Set NomeEvento = CCCreateControl(ccsLabel, "NomeEvento", Empty, ccsText, Empty, CCGetRequestParam("NomeEvento", ccsGet))
        Set Cidade = CCCreateControl(ccsLabel, "Cidade", Empty, ccsText, Empty, CCGetRequestParam("Cidade", ccsGet))
        Set UF = CCCreateControl(ccsLabel, "UF", Empty, ccsText, Empty, CCGetRequestParam("UF", ccsGet))
        Set Pais = CCCreateControl(ccsLabel, "Pais", Empty, ccsText, Empty, CCGetRequestParam("Pais", ccsGet))
        Set DataInicioEvento = CCCreateControl(ccsLabel, "DataInicioEvento", Empty, ccsDate, DefaultDateFormat, CCGetRequestParam("DataInicioEvento", ccsGet))
        Set Eventos_Insert = CCCreateControl(ccsLink, "Eventos_Insert", Empty, ccsText, Empty, CCGetRequestParam("Eventos_Insert", ccsGet))
        Set Navigator = CCCreateNavigator(ComponentName, "Navigator", FileName, 10, tpSimple)
    IsDSEmpty = True
    End Sub
'End Eventos Class_Initialize Event

'Eventos Initialize Method @9-2AEA3975
    Sub Initialize(objConnection)
        If NOT Visible Then Exit Sub

        Set DataSource.Connection = objConnection
        DataSource.PageSize = PageSize
        DataSource.SetOrder ActiveSorter, SortingDirection
        DataSource.AbsolutePage = PageNumber
    End Sub
'End Eventos Initialize Method

'Eventos Class_Terminate Event @9-B97CC660
    Private Sub Class_Terminate()
        Set CCSEvents = Nothing
        Set DataSource = Nothing
        Set Command = Nothing
        Set Errors = Nothing
        Set Attributes = Nothing
    End Sub
'End Eventos Class_Terminate Event

'Eventos Show Method @9-8F33E294
    Sub Show(Tpl)
        Dim HasNext
        If NOT Visible Then Exit Sub

        Dim RowBlock

        With DataSource
            .Parameters("urls_IdEvento") = CCGetRequestParam("s_IdEvento", ccsGET)
            .Parameters("urls_NomeEvento") = CCGetRequestParam("s_NomeEvento", ccsGET)
            .Parameters("urls_Cidade") = CCGetRequestParam("s_Cidade", ccsGET)
            .Parameters("urls_UF") = CCGetRequestParam("s_UF", ccsGET)
            .Parameters("urls_Pais") = CCGetRequestParam("s_Pais", ccsGET)
        End With

        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeSelect", Me)
        Set Recordset = DataSource.Open(Command)
        If DataSource.Errors.Count = 0 Then IsDSEmpty = Recordset.EOF

        Set TemplateBlock = Tpl.Block("Grid " & ComponentName)
        If TemplateBlock is Nothing Then Exit Sub
        Set RowBlock = TemplateBlock.Block("Row")
        Set StaticControls = CCCreateCollection(TemplateBlock, Null, ccsParseOverwrite, _
            Array(Sorter_IdEvento, Sorter_NomeEvento, Sorter_Cidade, Sorter_UF, Sorter_Pais, Sorter_DataInicioEvento, Eventos_Insert, Navigator))
            
            Eventos_Insert.Parameters = CCGetQueryString("QueryString", Array("IdEvento", "ccsForm"))
            Eventos_Insert.Page = "Eventos_maint.asp"
            Navigator.SetDataSource Recordset
        Set RowControls = CCCreateCollection(RowBlock, Null, ccsParseAccumulate, _
            Array(IdEvento, NomeEvento, Cidade, UF, Pais, DataInicioEvento))

        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShow", Me)
        If NOT Visible Then Exit Sub

        RowControls.PreserveControlsVisible
        Errors.AddErrors DataSource.Errors
        If Errors.Count > 0 Then
            TemplateBlock.HTML = CCFormatError("Grid " & ComponentName, Errors)
        Else

            ' Show NoRecords block if no records are found
            If Recordset.EOF Then
                Attributes.Show TemplateBlock, "Eventos:"
                TemplateBlock.Block("NoRecords").Parse ccsParseOverwrite
            End If
            HasNext = HasNextRow()
            ForceIteration = False
            Do While ForceIteration Or HasNext
                If HasNext Then
                    IdEvento.Value = Recordset.Fields("IdEvento")
                    IdEvento.Parameters = CCGetQueryString("QueryString", Array("ccsForm"))
                    IdEvento.Parameters = CCAddParam(IdEvento.Parameters, "IdEvento", Recordset.Fields("IdEvento_param1"))
                    IdEvento.Page = "Eventos_maint.asp"
                    NomeEvento.Value = Recordset.Fields("NomeEvento")
                    Cidade.Value = Recordset.Fields("Cidade")
                    UF.Value = Recordset.Fields("UF")
                    Pais.Value = Recordset.Fields("Pais")
                    DataInicioEvento.Value = Recordset.Fields("DataInicioEvento")
                End If
                CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeShowRow", Me)
                Attributes.Show TemplateBlock.Block("Row"), "Eventos:"
                RowControls.Show
                If HasNext Then Recordset.MoveNext
                ShownRecords = ShownRecords + 1
                HasNext = HasNextRow()
            Loop
            Attributes.Show TemplateBlock, "Eventos:"
            StaticControls.Show
        End If

    End Sub
'End Eventos Show Method

'Eventos PageSize Property Let @9-54E46DD6
    Public Property Let PageSize(NewValue)
        VarPageSize = NewValue
        DataSource.PageSize = NewValue
    End Property
'End Eventos PageSize Property Let

'Eventos PageSize Property Get @9-9AA1D1E9
    Public Property Get PageSize()
        PageSize = VarPageSize
    End Property
'End Eventos PageSize Property Get

'Eventos RowNumber Property Get @9-F32EE2C6
    Public Property Get RowNumber()
        RowNumber = ShownRecords + 1
    End Property
'End Eventos RowNumber Property Get

'Eventos HasNextRow Function @9-9BECE27A
    Public Function HasNextRow()
        HasNextRow = NOT Recordset.EOF AND ShownRecords < PageSize
    End Function
'End Eventos HasNextRow Function

End Class 'End Eventos Class @9-A61BA892

Class clsEventosDataSource 'EventosDataSource Class @9-550438CF

'DataSource Variables @9-ABAAA2FE
    Public Errors, Connection, Parameters, CCSEvents

    Public Recordset
    Public SQL, CountSQL, Order, Where, Orders, StaticOrder
    Public PageSize
    Public PageCount
    Public AbsolutePage
    Public Fields
    Dim WhereParameters
    Public AllParamsSet
    Public CmdExecution
    Public InsertOmitIfEmpty
    Public UpdateOmitIfEmpty

    Private CurrentOperation
    Private CCSEventResult

    ' Datasource fields
    Public IdEvento
    Public IdEvento_param1
    Public NomeEvento
    Public Cidade
    Public UF
    Public Pais
    Public DataInicioEvento
'End DataSource Variables

'DataSource Class_Initialize Event @9-5E956BD4
    Private Sub Class_Initialize()

        Set CCSEvents = CreateObject("Scripting.Dictionary")
        Set Fields = New clsFields
        Set Recordset = New clsDataSource
        Set Recordset.DataSource = Me
        Set Errors = New clsErrors
        Set Connection = Nothing
        AllParamsSet = True
        Set IdEvento = CCCreateField("IdEvento", "IdEvento", ccsInteger, Empty, Recordset)
        Set IdEvento_param1 = CCCreateField("IdEvento_param1", "IdEvento", ccsText, Empty, Recordset)
        Set NomeEvento = CCCreateField("NomeEvento", "NomeEvento", ccsText, Empty, Recordset)
        Set Cidade = CCCreateField("Cidade", "Cidade", ccsText, Empty, Recordset)
        Set UF = CCCreateField("UF", "UF", ccsText, Empty, Recordset)
        Set Pais = CCCreateField("Pais", "Pais", ccsText, Empty, Recordset)
        Set DataInicioEvento = CCCreateField("DataInicioEvento", "DataInicioEvento", ccsDate, Array("yyyy", "-", "mm", "-", "dd", " ", "HH", ":", "nn", ":", "ss"), Recordset)
        Fields.AddFields Array(IdEvento, IdEvento_param1, NomeEvento, Cidade, UF, Pais, DataInicioEvento)
        Set Parameters = Server.CreateObject("Scripting.Dictionary")
        Set WhereParameters = Nothing
        Orders = Array( _ 
            Array("Sorter_IdEvento", "IdEvento", ""), _
            Array("Sorter_NomeEvento", "NomeEvento", ""), _
            Array("Sorter_Cidade", "Cidade", ""), _
            Array("Sorter_UF", "UF", ""), _
            Array("Sorter_Pais", "Pais", ""), _
            Array("Sorter_DataInicioEvento", "DataInicioEvento", ""))

        SQL = "SELECT TOP {SqlParam_endRecord} IdEvento, NomeEvento, Cidade, UF, Pais, DataInicioEvento  " & vbLf & _
        "FROM Eventos {SQL_OrderBy}"
        CountSQL = "SELECT COUNT(*) " & vbLf & _
        "FROM Eventos"
        Where = ""
        Order = "DataInicioEvento"
        StaticOrder = ""
    End Sub
'End DataSource Class_Initialize Event

'SetOrder Method @9-68FC9576
    Sub SetOrder(Column, Direction)
        Order = Recordset.GetOrder(Order, Column, Direction, Orders)
    End Sub
'End SetOrder Method

'BuildTableWhere Method @9-D30A1B07
    Public Sub BuildTableWhere()
        Dim WhereParams

        If Not WhereParameters Is Nothing Then _
            Exit Sub
        Set WhereParameters = new clsSQLParameters
        With WhereParameters
            Set .Connection = Connection
            Set .ParameterSources = Parameters
            Set .DataSource = Me
            .AddParameter 1, "urls_IdEvento", ccsInteger, Empty, Empty, Empty, False
            .AddParameter 2, "urls_NomeEvento", ccsText, Empty, Empty, Empty, False
            .AddParameter 3, "urls_Cidade", ccsText, Empty, Empty, Empty, False
            .AddParameter 4, "urls_UF", ccsText, Empty, Empty, Empty, False
            .AddParameter 5, "urls_Pais", ccsText, Empty, Empty, Empty, False
            .Criterion(1) = .Operation(opEqual, False, "IdEvento", .getParamByID(1))
            .Criterion(2) = .Operation(opContains, False, "NomeEvento", .getParamByID(2))
            .Criterion(3) = .Operation(opContains, False, "Cidade", .getParamByID(3))
            .Criterion(4) = .Operation(opContains, False, "UF", .getParamByID(4))
            .Criterion(5) = .Operation(opContains, False, "Pais", .getParamByID(5))
            .AssembledWhere = .opAND(False, .opAND(False, .opAND(False, .opAND(False, .Criterion(1), .Criterion(2)), .Criterion(3)), .Criterion(4)), .Criterion(5))
            WhereParams = .AssembledWhere
            If Len(Where) > 0 Then 
                If Len(WhereParams) > 0 Then _
                    Where = Where & " AND " & WhereParams
            Else
                If Len(WhereParams) > 0 Then _
                    Where = WhereParams
            End If
        End With
    End Sub
'End BuildTableWhere Method

'Open Method @9-85D3380D
    Function Open(Cmd)
        Errors.Clear
        If Connection Is Nothing Then
            Set Open = New clsEmptyDataSource
            Exit Function
        End If
        Set Cmd.Connection = Connection
        Cmd.CommandOperation = cmdOpen
        Cmd.PageSize = PageSize
        Cmd.ActivePage = AbsolutePage
        Cmd.CommandType = dsTable
        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeBuildSelect", Me)
        Cmd.SQL = SQL
        Cmd.CountSQL = CountSQL
        BuildTableWhere
        Cmd.Where = Where
        Cmd.OrderBy = Order
        If(Len(StaticOrder)>0) Then
            If Len(Order)>0 Then Cmd.OrderBy = ", "+Cmd.OrderBy
            Cmd.OrderBy = StaticOrder + Cmd.OrderBy
        End If
        Cmd.Options("CLAUSE") = " TOP {SqlParam_endRecord}"
        Cmd.Options("SYNTAX") = "Top"
        Cmd.Options("PLACE") = "beforeFrom"
        CCSEventResult = CCRaiseEvent(CCSEvents, "BeforeExecuteSelect", Me)
        If Errors.Count = 0 And CCSEventResult Then _
            Set Recordset = Cmd.Exec(Errors)
        CCSEventResult = CCRaiseEvent(CCSEvents, "AfterExecuteSelect", Me)
        Set Recordset.FieldsCollection = Fields
        Set Open = Recordset
    End Function
'End Open Method

'DataSource Class_Terminate Event @9-41B4B08D
    Private Sub Class_Terminate()
        If Recordset.State = adStateOpen Then _
            Recordset.Close
        Set Recordset = Nothing
        Set Parameters = Nothing
        Set Errors = Nothing
    End Sub
'End DataSource Class_Terminate Event

End Class 'End EventosDataSource Class @9-A61BA892

'Include Page Implementation @37-FD86017A
%>
<!-- #INCLUDE VIRTUAL="/fepace/Header.asp" -->
<%
'End Include Page Implementation

'Include Page Implementation @38-C597799D
%>
<!-- #INCLUDE VIRTUAL="/fepace/Footer.asp" -->
<%
'End Include Page Implementation


%>
